home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6892 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.4 KB  |  42 lines

  1. Path: sun001.spd.dsccc.com!spd!jmccarty
  2. From: jmccarty@spd.dsccc.com (Mike McCarty)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Big and little endians
  5. Date: 16 Feb 1996 00:14:18 GMT
  6. Organization: DSC Communications Corporation, Plano, Texas USA
  7. Message-ID: <4g0i8q$pni@sun001.spd.dsccc.com>
  8. References: <4fuuqq$fpp@due.unit.no>
  9. NNTP-Posting-Host: aplo139.spd.dsccc.com
  10.  
  11. In article <4fuuqq$fpp@due.unit.no>, Vidar Moe  <vidarm@ibt.unit.no> wrote:
  12. )What exactly is meant by the terms little-endians and 
  13. )big-endians?
  14. )
  15. )Vidar Moe.
  16.  
  17. This is a non-language related question.
  18.  
  19. Nevertheless:
  20.  
  21. A big-endian machine stores the more significant byte of multibyte
  22. integers in the smaller addresses. The 680x0 family of machines is
  23. big-endian. Example: 0x12345678 is stored in memory as 0x12, 0x34, 0x56,
  24. 0x78, in that order, in consecutive bytes.
  25.  
  26. A little-endian machine stores the more significant byte of multibyte
  27. integers in the larger addresses. The 80x86 family of machines is
  28. little-endian. Example: 0x12345678 is stored in memory as 0x78, 0x56,
  29. 0x34, 0x12, in that order, in consecutive bytes.
  30.  
  31. Either method works. As with everything, people usually prefer what they
  32. first learned on. As with everything for which there is no good reason
  33. to choose between methods, there are religious camps which argue
  34. interminably over which is better.
  35.  
  36. Mike
  37.  
  38. ----
  39. char *p="char *p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
  40.  
  41. I don't speak for DSC.         <- They make me say that.
  42.